{namespace lfe=SGalinski\Lfeditor\ViewHelpers}
{namespace core=TYPO3\CMS\Core\ViewHelpers}

<f:layout name="Default" />

<f:section name="selectItems">
	<f:render partial="SelectExtensionAndLanguageFile" arguments="{_all}" />
</f:section>

<f:section name="main">
	<f:if condition="{extensionSelection} && {languageFileSelection} && {languages}">
		<div class="panel panel-default">
			<div class="panel-heading">
				<f:translate key="function.const.add.add" />
			</div>
			<div class="panel-body">
				<f:form id="contentForm" action="addConstantSave">
					<f:if condition="{constantSelection} != '###default###'">
						<div class="form-group">
							<label>
								<f:translate key="function.const.add.name" />
							</label>
							<f:form.textfield name="nameOfConstant" class="form-control" />
						</div>

						<f:for each="{languages}" as="lang" iteration="iterator">
							<fieldset class="tx-lfeditor-fieldset bgColor5 {f:if(condition: iterator.isEven, then: 'tx-lfeditor-fright')}{f:if(condition: iterator.isOdd, then: 'tx-lfeditor-fleft')}">
								<legend class="bgColor3">
									{f:if(condition: '{lang} == \'default\'', then: 'en', else: '{lang}')}
								</legend>
								<f:form.textarea
									cols="80" rows="{numTextAreaRows}"
									name="addConstTextArea[{lang}]"
									lang="{f:if(condition: '{lang} == \'default\'', then: 'en', else: '{lang}')}"
									class="tx-lfeditor-textarea" />
							</fieldset>
						</f:for>
					</f:if>
				</f:form>
			</div>
		</div>
	</f:if>
</f:section>

<f:section name="ButtonBarLeft">
	<button class="btn btn-default btn-sm" onclick="document.getElementById('contentForm').submit();">
		<core:icon identifier="actions-save" />
		<f:translate key="button.save" />
	</button>
</f:section>
